import keymaster from "keymaster";

export const useKeymater = () => {
  const unbind = (key: string) => {
    keymaster.unbind(key);
  };
  const bind = (key: string, cb: () => void) => {
    keymaster(key, () => {
      cb();
      return false;
    });
  };
  return {
    unbind,
    bind,
  };
};
